package com;

import java.awt.*;

public class MapBottom {
    BottomRay bottomRay = new BottomRay();
    //绘制方法
    void paintSelf(Graphics g) {
        for (int i = 0; i < 1000; i = i + 50) {
            g.setColor(Color.blue);

        }
        //画竖线
        for (int i = 0; i <= GameUntil.MAP_W; i++) {
            g.drawLine(GameUntil.OFFSET + i * GameUntil.SQUARE_LENGTH,
                    3 * GameUntil.OFFSET,
                    GameUntil.OFFSET + i * GameUntil.SQUARE_LENGTH,
                    3 * GameUntil.OFFSET + GameUntil.MAP_H * GameUntil.SQUARE_LENGTH);
        }
        //画横线
        for (int i = 0; i <= GameUntil.MAP_H; i++) {
            g.drawLine(GameUntil.OFFSET, 3 * GameUntil.OFFSET + i * GameUntil.SQUARE_LENGTH,
                    GameUntil.OFFSET + GameUntil.MAP_W * GameUntil.SQUARE_LENGTH,
                    3 * GameUntil.OFFSET + i * GameUntil.SQUARE_LENGTH);
        }
        for (int i = 1; i <= GameUntil.MAP_W; i++) {
            for (int j = 1; j <= GameUntil.MAP_H; j++) {
                if (GameUntil.DATA_Bottom[i][j] == -1) {

                    g.drawImage(GameUntil.lei,
                            GameUntil.OFFSET + (i - 1) * GameUntil.SQUARE_LENGTH + 1,
                            GameUntil.OFFSET * 3 + (j - 1) * GameUntil.SQUARE_LENGTH + 1,
                            GameUntil.SQUARE_LENGTH + 2,
                            GameUntil.SQUARE_LENGTH + 2,
                            null);
                }
            }


        }
    }

}
